using System.Collections;

public class TitanfallV2GameMode : DeathmatchGameMode
{
	public override void StartRound()
	{
		base.StartRound();
		GameInfoWindow.instance.ShowTitanfallInfo(true);
		PlayerBehavior.MyPlayer.Points = 0;
		TitanSpawner.instance.ResetTitanSpawnRecharge();
		TDMController.instance.SetStartPVP(true);
		PlayerBehavior.MyPlayer.FirstSpawn(2.5f);
		CoroutineRunner.Invoke(3f, delegate
		{
			GameInfoWindow.instance.HideInterface();
			GameController.instance.showWindowGame();
			TitanTutor.instance.ShowArrowAndTextByStartTitanfall();
			if (PvPLeaderbord.instance != null)
			{
				PvPLeaderbord.instance.EnableLeaderboard(true);
			}
		});
	}

	public override void RestartRound()
	{
		base.RestartRound();
		CoroutineRunner.Instance.StartCoroutine(WaitRestartRoundTFV2());
	}

	public override void EndRound()
	{
		TitanSpawner.instance.HideMyTitanWithDelay(2f);
	}

	private IEnumerator WaitRestartRoundTFV2()
	{
		while (PVPManager.instance.gameEnded || !ManagerPreloadingSectors.thisScript.sectorsLoaded)
		{
			yield return null;
		}
		StartRound();
	}
}
